﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Elasticsearch.Net;
using Nest;

namespace ES
{
    /// <summary>
    /// ES配置 (集群待补充)
    /// </summary>
    public static class ElasticSearchConfig
    { 
        public  static  string esUrl = ConfigurationManager.ConnectionStrings["ElasticSearchConfig"].ConnectionString;
        public static IElasticClient  EsClient;
        /// <summary>
        /// 索引别名 索引名称必须小写
        /// </summary>
        public static string IndexName = "cylongindex";

        static ElasticSearchConfig()
        {
            EsClient = new ElasticClient(new ConnectionSettings(new Uri(esUrl)).DefaultIndex(IndexName)); 
        }
         
    }
 }
